package mysql

import "gorm.io/gorm"

type Doctor struct {
	gorm.Model
	DoctorName    string `gorm:"type:varchar(50)"`
	DoctorAddress string `gorm:"type:varchar(200)"`
	DoctorDetail  string `gorm:"type:varchar(200)"`
}

func (d *Doctor) DoctorAdd(db *gorm.DB) error {
	return db.Debug().Create(d).Error
}

func (d *Doctor) DoctorUpdate(db *gorm.DB, id int64) error {
	return db.Debug().Where("id=?", id).Updates(d).Error
}

func (d *Doctor) DoctorShow(db *gorm.DB, id int64) error {
	return db.Debug().Where("id=?", id).First(d).Error
}
